<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
</head>
<body>
<div contenteditable="true" id="e" style="width:600px;height: 400px;border: 1px solid red;">

</div>
<br>
<button onclick="document.getElementById('html').value=document.getElementById('e').innerHTML.toLowerCase();">获取html</button>
<br>
<textarea id="html"  style="width:600px;height: 400px;">

</textarea>
</body>
</html>